Skip to content

Share native and plugin question forms with compact interaction UI - #3147

Merged
ymichael merged 10 commits into
mainfrom
bb/compact-ask-user-ui-thr_s6jvvc43fw
Sep 8, 2026
Merged

ymichael merged 10 commits into
mainfrom
bb/compact-ask-user-ui-thr_s6jvvc43fw

Conversation

@ymichael

@ymichael ymichael commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Built-in questions and the ask-user-question plugin duplicated their form UI, state, and shortcut handling. Their containers also diverged: built-in prompts had an orange border and collapse controls while plugin forms used a neutral border without collapse controls. Compact permission prompts wrapped across multiple lines on mobile.

What changed

  • Use one PendingInteractionShell for built-in questions, approvals, plan reviews, and plugin forms: neutral border, attention dot, title/caret disclosure controls, and a single-line compact mobile layout.
  • Use one QuestionForm and answer-state implementation for built-in and plugin questions, including tabs, single/multiple selection, Other/free text, validation, navigation, and option previews. Delete the duplicate implementations and consolidate form tests.
  • Keep small transport adapters: built-in questions submit a user_answer resolution and cancellation stops the thread; the plugin submits {answers} and retains its interaction cancellation behavior.
  • Route both forms through the app's configured question shortcuts, limited to the focused pane. Collapsing pauses shortcut effects while preserving draft text, selections, and the active question. Typing in an input does not select answers.
  • Share the internal question-host React context across plugin bundles through a runtime shim. No public Plugin SDK, CLI, or server/daemon wire changes.
  • Title taps toggle the form; approval actions remain separate controls in the expanded form. Escape collapses and restores focus. Attention-dot policy is unchanged by the form refactor.

How you verified

  • App: 50 targeted tests passed across shared form/state, native adapter/shell, plugin composer, shortcuts, and runtime installation. The native adapter regression also checks the submitted resolution and thread cancellation.
  • Ask-user-question plugin: 30 tests passed, including submission, cancellation, invalid payloads, server behavior, and translation.
  • Plugin build: 11 tests passed, including a bundled-module check that the question-host hook uses the host runtime instance.
  • pnpm exec turbo run typecheck lint --filter=@bb/app --filter=@bb/shared-ui --filter=bb-plugin-ask-user-question --filter=@bb/plugin-build passed. Formatting and diff checks passed.
  • Dev-browser against native and actual plugin-source Ladle fixtures: desktop selections, multiselect/free text, mobile single-line collapse, title-tap expansion, and retained draft/current question. Earlier permission checks cover compact decisions and mobile expansion.
  • Rebuilt and restarted using pnpm start:worktree; app responds HTTP 200 and the host daemon connects.
  • Verification inventory has an unrelated existing failure: unmapped browser CLI family.

Screenshots

Before / After screenshot gallery — 19 surfaces/states × desktop/mobile × compact/expanded, compared with PR base 6cdb4ba612. Both columns use the same fixture data and viewport sizes; select a surface to compare it directly. Plugin forms without an earlier compact mode show their actual expanded Before view with an explicit label. Each image opens at full size.

All 38 compact captures measure 38px high with no horizontal overflow. This includes built-in and plugin questions, command/file/tool permissions, child-thread approvals, plan review, resolving requests, secrets, unavailable plugins, errors, Other answers, and free-text drafts. Compact errors use a red dot without competing with the title; expanded errors show the full message.

Compact mode now shows the short label (for example, Approval needed), dot, and caret; details, source links, and decisions appear after expansion. Expanded headings remain readable, with child-thread links truncating first. Attention dots align with the first line when headings wrap. All 3,935 app tests passed (3 skipped), along with typecheck and lint.

Desktop compact Mobile compact
Desktop compact before and after Mobile compact before and after
Desktop expanded Mobile expanded
Desktop expanded before and after Mobile expanded before and after

Browser captures use synthetic Ladle previews at 1280px and 390px viewport widths; mobile is Chromium emulation. No credentials entered. Following the compact-error change, 20 shell/controller tests, app typecheck, and lint passed.

AGENT GENERATED

@ymichael ymichael changed the title Add compact question forms and single-line mobile permission prompts Unify question and permission forms in a shared compact shell Sep 5, 2026
@ymichael
ymichael force-pushed the bb/compact-ask-user-ui-thr_s6jvvc43fw branch from 4e0f05b to 6e3a522 Compare September 6, 2026 06:41
@ymichael ymichael changed the title Unify question and permission forms in a shared compact shell Share native and plugin question forms with compact interaction UI Sep 6, 2026
@ymichael

ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

@slopcop

@bb-slop-cop

bb-slop-cop Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🚨 SLOP COP 🚨 · review

I’m reviewing this pull request now. I’ll check security, general code quality and architectural duplication, performance, and the end-to-end question interaction flow, then return with one synthesized review.

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 SLOP COP 🚨 · review

Plain-English summary: this PR replaces two separate question-form implementations with one shared form and one compact interaction shell. Native provider questions and plugin-provided questions now use the same selections, free-text answers, previews, keyboard shortcuts, collapse behavior, and visual treatment, while keeping their existing submission adapters.

No blocking findings. The security review found no new injection, authority, validation, or interaction-resolution risks. The production architecture now removes the native/plugin duplication cleanly, and the bounded render/state work introduces no meaningful performance regression.

One low-severity follow-up: plans/bb-mobile-research/thread-view-promptbox.md lines 18 and 106 still reference the deleted app-local user-question-form-state.ts and describe that state as app-local. Please update the mobile reuse inventory to point to packages/shared-ui/src/components/ui/question-form-state.ts and question-form.tsx, with PendingInteractionShell.tsx and ThreadQuestionFormHost.tsx called out as app-specific integration. This is documentation drift, not a merge blocker.

Verification on 69b7da8dce789b46ad22f925debdeefb06a7757b:

  • Started an isolated source dev app with a fresh store and drove the real fallback Ask User Question plugin through Doobie. A two-question card rendered in the compact shell; numbered shortcuts selected single- and multi-select answers; the selected option exposed its multiline preview; collapse/re-expand preserved the active question and selections; submit removed the pending interaction; and the waiting agent received exactly Layout: Spacious and Extras: Keyboard shortcuts, Option previews.
  • The native Claude Code live path was attempted but blocked before rendering by an expired OAuth session. Native/shared behavior was still covered by source tracing and the passing app suite.
  • @bb/app and @bb/shared-ui: 481 test files passed, 3,934 tests passed, 4 skipped.
  • bb-plugin-ask-user-question: 30 tests passed. The changed plugin-app build test passed all 11 tests. A broader local plugin-build run also hit two unchanged path-string assertions caused by macOS /tmp resolving to /private/tmp; those files are outside this PR diff, and head CI is green.
  • Focused Turbo typechecks passed for the app, shared UI, plugin, and plugin build. Lint completed with 0 errors. git diff --check passed.
  • The verification inventory still reports the already-known unrelated unmapped browser CLI family. All required CI checks on the reviewed SHA are green.

@ymichael
ymichael merged commit aabc61c into main Sep 8, 2026
25 of 26 checks passed
@ymichael
ymichael deleted the bb/compact-ask-user-ui-thr_s6jvvc43fw branch September 8, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant